<script>
	
		$(document).ready(function(){
		   
		   
		  /* if($("#role").val()==1)
		   {
		   	$("#department").hide();
		   	$("#departmentit").show();
		   }
		   else
		   {
		   		$("#department").show();
		   	$("#departmentit").hide();
		   }
		   
	$("#role").change(function(){
		
	if ($("#role").val()==1)
    {
    	$("#department").hide();
		   	$("#departmentit").show();
    }
    else if ($("#role").val()==2)
    {
    	$("#department").show();
		   	$("#departmentit").hide();
    }
  });*/

$(function(){
				// Datepicker

				$('#datepicker').datepicker({
					dateFormat: 'dd MM yy',
					changeMonth: true,
					changeYear: true,
					inline: true,
					 yearRange: '1962:2000'
					//dateFormat: 'yy-mm-dd',
				});

			//$( "#datepicker" ).datepicker( "option", "yearRange", '1962:2000' );
				
			});


});
	
	
			


</script>
<!-- start content -->
<div id="content">

<!--  start page-heading -->
	<div id="page-heading">
		<h1>Staff: [ Ubah ]</h1>
	</div>

<div id="topmenu" align="right">
<ul id="list">

<li><div align="center">&nbsp;<a href="<?=base_url()?>admin/staff"><img src="<?=base_url()?>asset/images/backend/user2.png" align="middle" width="40" height="40"><br/>Lihat Staff</a></div></li>&nbsp;&nbsp;&nbsp;&nbsp;
<li><div align="center"><a href="<?=base_url()?>admin/staff_add_form"><img src="<?=base_url()?>asset/images/backend/user2add.png" align="middle" width="40" height="40">&nbsp;<br/>Tambah Staff</a></div></li>
<li><div align="center"><a href="<?=base_url()?>admin/staff_access"><img src="<?=base_url()?>asset/images/backend/user2.png" align="middle" width="40" height="40">&nbsp;<br/>Lihat Akses Staff</a></div></li>
<li><div align="center"><a href="<?=base_url()?>admin/staff_access_add_form"><img src="<?=base_url()?>asset/images/backend/user2add.png" align="middle" width="40" height="40">&nbsp;<br/>Tambah Akses Staff</a></div></li>
</ul>
</div>



<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
	<th rowspan="3" class="sized"><img src="<?=base_url()?>asset/images/backend/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
	<th class="topleft"></th>
	<td id="tbl-border-top">&nbsp;</td>
	<th class="topright"></th>
	<th rowspan="3" class="sized"><img src="<?=base_url()?>asset/images/backend/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
</tr>
<tr>
	<td id="tbl-border-left"></td>
	<td>
	<!--  start content-table-inner -->
	<div id="content-table-inner">
	
	<?php
		$staff_id=$this->uri->segment(3);
		$attributes = array('class' => 'admin', 'id' => 'addstaff','name' => 'addstaff','enctype'=>'multipart/form-data');
		echo form_open('admin/staff_edit/'.$staff_id, $attributes);
	?>
          
               
	<table border="0" width="70%" cellpadding="0" cellspacing="0">
            <th><h2>Informasi Dasar</h2></th>
       <tr>
		      <th colspan="2" valign="middle" height="4"></th>
		      </tr>
		      <?php
		      if(isset($staff))
			  {
			  	foreach($staff as $row)
				{
			  	?>
			  	  <tr>
            
			
			<th valign="middle"><div align="left">Kartu ID:</div></th>
			<td valign="middle">
				<input type="text" name="id_card" id="id_card" value="<?=$row->id_card?>" class="inp-form" />
				
			</td>
                       
		</tr>
	<tr>
            
			
			<th valign="middle"><div align="left">Nama:</div></th>
			<td valign="middle"><input type="text" name="name" id="name" value="<?=$row->staff_name?>" class="inp-form" /></td>
                        
		</tr>
		
		<tr>
            
			
			<th valign="middle"><div align="left">Jenis Kelamin:</div></th>
			<td valign="middle">
			
			 <select name="gender" id="gender" class="styledselect_form_1">
			 	<?php
			 	if($row->gender=='pria')
				{
					?>
					<option selected="selected" value="pria">Pria</option>
			 	<option value="wanita">Wanita</option>
					<?php
				}
				else
					{
						?>
						<option value="pria">Pria</option>
			 			<option selected="selected" value="wanita">Wanita</option>
						<?php
					}
			 	?>
			 	
			 </select>
			
			</td>
                      
		</tr>
                
    <tr>
	
			<td valign="middle"><div align="left"><strong>Tanggal lahir:</strong></div></td>
			<td valign="middle"><input type="text" name="dob" id="datepicker" value="<?=date("d M Y",strtotime($row->dob))?>" class="inp-form"/></td>
		 
                 </tr>
                
		<tr>
			<th valign="middle"><div align="left">Alamat:</div></th>
			<td valign="middle"><input type="text" name="address" id="address" value="<?=$row->address?>" class="inp-form" /></td>
		</tr>
		<tr>
			<th valign="middle"><div align="left">No Telepon:</div></th>
			<td valign="middle"><input type="text" name="phone" id="phone" value="<?=$row->contact?>" class="inp-form" /></td>
		</tr>
		<tr>
			<th valign="middle"><div align="left"><strong>E-</strong>Mail:</div></th>
			<td valign="middle"><input type="text" name="email" id="email" value="<?=$row->email?>" class="inp-form" /></td>
                        
                </tr>
                <tr>
		<th valign="middle"><div align="left">Departemen:</div></th>
		<td valign="middle">	
		<select name="department" id="department" class="styledselect_form_1">
			<?php
				if($department>0)
				{
					foreach($department as $rowz)
					{
						if($rowz->id==$row->department_id)
						{
							echo "<option selected=\"selected\" value='".$rowz->id."'>".$rowz->name."</option>";
						}
						else
							{
								echo "<option value='".$rowz->id."'>".$rowz->name."</option>";
							}
						
					}
				}
			?>
		</select>	
	
		
		</td>
		</tr>
			  	<?php
			  	}  
			  }
			  else
			  	{
			  		$this->load->view('notification/v_datanotfound');
			  	}
		      ?>
		  
		
		
			
		    <tr>
		      <th colspan="2" valign="middle" height="10"></th>
		      </tr>
		      
		    
		
               
            
                
                 
        
        <tr>
		<th>&nbsp;</th>
		<td valign="top">
			<input type="submit" value="" class="form-submit" />
			<input type="reset" value="" class="form-reset"  />		</td>
	</tr>
        </table>
            <?=form_close()?>
            <!-- end id-form  -->
                </div>


               
                
<div class="clear">&nbsp;</div>

</div>
<script  type="text/javascript">

</script>
<!--  end content -->